﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage/List2.Master"  AutoEventWireup="true" CodeBehind="BD_Contract_List.aspx.cs" Inherits="Honestysoft.Financing.WebUI.Module.Contract.BD_Contract_List"  %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script language="javascript" type="text/javascript">
        function doConfirm() {
            var ret = getNoSelectionAlert('chkID', '请选择要确认的记录后再执行此操作！');
            if (!ret) {return;}
            var arrId = new Array();
            var j = 0;
            var elm = document.getElementsByName('chkID');
            if (elm != null) {
                for (i = 0; i < elm.length; i++) {
                    if (elm[i].checked) {
                        arrId[j] = elm[i].value;
                        j++;
                    }
                }
            }
            var retValue = window.showModalDialog('ContractConfirm.aspx', arrId, 'dialogHeight=500px;dialogWidth=560px;help=no;scrollbars=no;status=no');
            if (typeof (retValue) != "undefined" && retValue != null && retValue) {
                window.location.href = window.location.href;
            }            
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">		
    <div class="query_area">
        项目编号：<asp:TextBox ID="txtProjectCode" runat="server"  cssClass="input2" MaxLength="200" Width="80px"></asp:TextBox>&nbsp;&nbsp;	
        合同类别：<asp:DropDownList ID="ddlContractCategory" runat="server" cssClass="input2" ></asp:DropDownList>&nbsp;&nbsp;
		合同编号：<asp:TextBox ID="txtCode" runat="server"  cssClass="input2" MaxLength="200" Width="100px"></asp:TextBox>&nbsp;&nbsp;
		合同名称：<asp:TextBox ID="txtName" runat="server"  cssClass="input2" MaxLength="200" Width="100px"></asp:TextBox>&nbsp;&nbsp;		
        <asp:Button runat="server" ID="btnQuery" Text="查 找" CssClass="btn_normal" 
			onMouseOver="this.className='btn_active'" 
            onMouseOut="this.className='btn_normal'" OnClick="btnQuery_Click" />
    </div>            
    <div class="button_area">
        <asp:Button runat="server" ID="btnConfirm" Text="确认初始化"  style="display:none" OnClientClick="javascript:doConfirm();return false;" 
         class="btn_big_normal" onmouseover="this.className='btn_big_active'" 
            onmouseout="this.className='btn_big_normal'" />
        <asp:Button runat="server" ID="btnAdd" CssClass="btn_normal" 
			onMouseOver="this.className='btn_active'" 
            onMouseOut="this.className='btn_normal'" Text="新 增"/>
        <asp:Button runat="server" ID="btnDelete" CssClass="btn_normal" 
			onMouseOver="this.className='btn_active'" 
            onMouseOut="this.className='btn_normal'" Text="删 除" 
            OnClientClick="javascript:var ret=getNoSelectionAlert('chkID','请选择要删除的记录后再执行此操作！');if(ret){return confirm('确定要删除所选的记录吗?')}else{return false;}"             
            onclick="btnDelete_Click" />
    </div>
            
    <table cellpadding="0" width="100%" cellspacing="0" border="1" class="t1" id="tGrid">
		<thead>  
            <th align="center" width="30px">
                <input type="checkbox" name="chkAll" value="checkbox" onclick='javascript:checkAll(this,"chkID")' />
            </th>
            <th align="center" width="60px">合同类别</th>
            <th align="center" width="80px">合同编号</th>
            <th align="center">合同名称</th>
            <th align="center" width="100px">合同总价</th>
            <th width="50px">操作</th>
      	</thead>           
		<asp:Repeater runat="server" ID="rptList">
			<ItemTemplate>
				<tr>
					<td align="center" >
                        <%# GetCheckbox(DataBinder.Eval(Container.DataItem, "ID") + "", Convert.ToBoolean(DataBinder.Eval(Container.DataItem, "IsInit")), Convert.ToBoolean(DataBinder.Eval(Container.DataItem, "IsUse")))%>
					</td>
					<td><%# Honestysoft.DictionaryHelper.DictionaryInstance.GetDictionaryText(DataBinder.Eval(Container.DataItem,"ContractCategory")+"") %></td>
					<td><%#  DataBinder.Eval(Container.DataItem,"Code") %></td>
					<td align="left"><%# GetEditUrl(DataBinder.Eval(Container.DataItem, "ID") + "",  DataBinder.Eval(Container.DataItem,"Name")+"") %></td>
					<td align="right"><%# string.Format("{0:N}" , DataBinder.Eval(Container.DataItem,"TotalPrice")) %></td>
                    <td>
						<%# GetButtonScript(DataBinder.Eval(Container.DataItem, "ID") + "", Convert.ToBoolean(DataBinder.Eval(Container.DataItem, "IsInit")), Convert.ToBoolean(DataBinder.Eval(Container.DataItem, "IsUse")))%>
					</td>
				</tr>  
			</ItemTemplate>
		</asp:Repeater>
        <tr>
            <td colspan="6" style="line-height: 28px;text-align:left;">
                <frameworkwebcontrols:aspnetpager id="AspNetPager1" runat="server"
                    alwaysshow="true" firstpagetext="首页" lastpagetext="尾页" nextpagetext="下一页" pageindexboxtype="DropDownList"
                    prevpagetext="上一页" showpageindex="true" showcustominfosection="Right" submitbuttontext="Go"
                    textafterpageindexbox="页" textbeforepageindexbox="转到" currentpagebuttonposition="End"
                    layouttype="Div" custominfotextalign="Right" custominfohtml="共%RecordCount%条记录。第%CurrentPageIndex%页，共%PageCount%页，每页%PageSize%条"
                    direction="LeftToRight" onpagechanged="AspNetPager1_PageChanged">
                </frameworkwebcontrols:aspnetpager>            
            </td>
        </tr>
    </table>
</asp:Content>